home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / internet-tools / connect-line / cl / devkit / c / include / onlinelib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-12  |  1.9 KB  |  107 lines

  1. /*
  2.  * Interface: online.lib, allgemeiner Online-Kommando-Header
  3.  *
  4.  * $RCSfile$
  5.  * $Author$
  6.  * $Revision$
  7.  * $Date$
  8.  * $State$
  9.  * $Locker$
  10.  *
  11.  * $Log$
  12.  */
  13.  
  14. #ifndef _cl_onlinelib_H
  15. #define _cl_onlinelib_H
  16.  
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <string.h>
  20. #include <time.h>
  21.  
  22. #include <dos/dos.h>
  23. #include <dos/rdargs.h>
  24. #include <libraries/locale.h>
  25.  
  26. #include <proto/exec.h>
  27. #include <proto/dos.h>
  28. #include <proto/utility.h>
  29.  
  30. #include <CL/Types.h>
  31. #include <CL/cl_prefs.h>
  32. #include <CL/clutil.h>
  33. #include <CL/cl_text.h>
  34. #include <CL/UserShell.h>
  35.  
  36.  
  37. /*
  38.  * Zeiger auf UserShell-Struktur (Runtime-Environment)
  39.  */
  40.  
  41. extern CLUserShell *__clusershell;
  42. #define shell __clusershell
  43.  
  44.  
  45. /*
  46.  * Automatisch geƶffneter CL-Text-Katalog,
  47.  * Utility-Makros dazu
  48.  */
  49.  
  50. extern struct Locale        *__cmd_locale;
  51. extern APTR                    __cmd_catalog;
  52. extern APTR                    __shell_catalog;
  53.  
  54. /* utility macros */
  55. #define MSG( txt, def )        CLTXT_GetString( __cmd_catalog, txt, def )
  56. #define SHMSG( txt, def )    CLTXT_GetString( __shell_catalog, txt, def )
  57.  
  58. /* these use CLTXT token replacement functions... */
  59. APTR onl_sprintf( STRPTR to, STRPTR format, ... );
  60. APTR onl_printf( STRPTR format, ... );
  61.  
  62.  
  63. /*
  64.  * Support-Funktionen
  65.  */
  66.  
  67. #define IsUserPM( user, brett ) \
  68.     ( brett && user && ( !*brett || Stricmp( brett, user->Username ) == 0 ) )
  69.  
  70.  
  71. /*
  72.  * Range-Support
  73.  */
  74.  
  75. typedef struct cl_rangenode cl_rangenode;
  76.  
  77. struct cl_rangenode
  78. {
  79.     cl_rangenode    *next;
  80.     ulong            from, to;
  81. };
  82.  
  83. cl_rangenode *Text2Range( STRPTR *arg );
  84. cl_rangenode *FindRangeNode( cl_rangenode *head, ulong id );
  85.  
  86.  
  87. /*
  88.  * Signal-Handling
  89.  */
  90.  
  91. extern ulong __signals;
  92. #define CHECK_BREAK        (__signals = CheckSignal( \
  93.     SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D ))
  94. #define BREAK_C            (__signals & SIGBREAKF_CTRL_C)
  95. #define BREAK_D            (__signals & SIGBREAKF_CTRL_D)
  96.  
  97.  
  98. /*
  99.  * Standard-Texte
  100.  */
  101.  
  102. #define TXT_NOMEM SHMSG( "NoMem", "$(BOLD)Out of memory!$(NORMAL)\n" )
  103. #define TXT_BREAK SHMSG( "BreakDetected", "$(BOLD)[BREAK]$(NORMAL)\n" )
  104.  
  105.  
  106. #endif
  107.